package chap5;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Scoreavg {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        double sum=0;
        for(int i=1;i<=6;i++){
            System.out.print("请输入第"+i+"门课的成绩：");
            sum=sum+sc.nextDouble();
        }
        double avg=sum/6;
        //留一个小数点
        System.out.println(avg);
        System.out.println("平均分是:"+((int)(avg*10)/10.0));
    }
}
